package com.pd.wxAPI;

import com.pd.kit.UrlConnectionKit;
import com.pd.kit.UrlLinkKit;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by dong peng
 * DATE : 2016/12/25
 * TIME : 23:28.
 */


public class AccessToken {

    private static String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential";

    public static String getAccessToken() {
        String appid = "wx4d3957bd49aaeb75";
        String appsecret = "0f6fbb3d4bb9c716d58cdbeb267e0727";
        Map<String,String> map = new HashMap();
        map.put("appid",appid);
        map.put("secret",appsecret);
        String urlAll = UrlLinkKit.join(url,map);
        String result = UrlConnectionKit.getRequest(urlAll,null);
        System.out.println(result);
        return result;
    }

    public static void main(String[] args) {
        getAccessToken();
    }
}
